package com.example.myapplication.ArrayAdapterInclude;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import com.example.myapplication.R;

public class TextViewArrayAdapter extends ArrayAdapter<String> {
  public TextViewArrayAdapter(Context context, String[] data) {
    super(context, R.layout.listitem_view,data);
  }

  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    if (convertView == null) {
      convertView= LayoutInflater.from(getContext()).inflate(R.layout.listitem_view,parent,false);
    }
    TextView textView=(TextView) convertView.findViewById(R.id.nameView);
    textView.setText(getItem(position));
    return convertView;
  }

}
